import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
import App from '../App.vue';
// 假设登录页面路径
import Login from '../pages/login.vue';
import Layout from '@/components/layout/index.vue'
import Home from "@/pages/home.vue";
const routes = [
    {
        path: '/',
        component: Layout,
        name: 'mainRoute',
        children: [
            {
                path: 'home',
                name: 'home',
                component: Home,
            },
            {
                path: 'test',
                name: 'test',
                component: () => import('@/pages/list/test.vue')
            }
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    // 添加404路由
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: () => import('@/pages/404.vue')
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;
